package com.yllt4cloud.common.ddbase.constant;

/**
 * Created by Administrator on 2016/1/13.
 */
public class GlobalConstants {
    private GlobalConstants() {
    }

    //false;
    @Deprecated
    public static final Integer FLAG_FALSE = 0;
    //true;
    @Deprecated
    public static final Integer FLAG_TRUE = 1;

    //false;
    public static final Integer FALSE = 0;
    //true;
    public static final Integer TRUE = 1;

    //数据状态：启用
    public static final Integer STATUS_DATA_ENABLE = 1;
    //数据状态：停用（禁用、伪删除）
    public static final Integer STATUS_DATA_DISABLE = -1;


    //互动提出按次
    public static final int ZK_HUDONG_ANCI = 1;
    //是否始终均分提成比例
    public static final int ZK_HUDONG_JUNFEN = 2;
    //是否始终按一定比例提成
    public static final int ZK_HUDONG_BILI = 3;
    //是否提成始终给予订房人
    public static final int ZK_HUDONG_DINGFANGREN = 4;
    //第一次互动给予订房人
    public static final int ZK_HUDONG_DIYICI = 5;


    //操作人: 内部服务(线程)
    public static final Integer OPERATOR_INNER_SERVICE = -3;
    //操作人: 外部系统调用
    public static final Integer OPERATOR_WEB_SERVICE = -2;
    //操作人: 未登录用户
    public static final Integer OPERATOR_UNLOGIN = -1;
    //操作人: 系统
    public static final Integer OPERATOR_SYSTEM = 0;
    //设备：系统
    public static final Integer SHEBEI_SYSTEM = 0;

    //顶级部门的父id
    public static final Integer TOP_DEPARTMENT_PARENT_ID = 0;

    //转并放 1：转房 2：并房
    public static final Integer ZHUANGBINGFANG_LEIXING_ZHUANGFANG = 1;
    public static final Integer ZHUANGBINGFANG_LEIXING_BINFANG = 2;

    //房台状态
    //空房
    public static final Integer ROOM_KONGFANG_FLAG = 0;
    //已预定
    public static final Integer ROOM_YUDING_FLAG = 1;
    //与开房
    public static final Integer ROOM_YUKAIFANG_FLAG = 2;
    //开房
    public static final Integer ROOM_KAIFANG_FLAG = 3;
    //结账中
    public static final Integer ROOM_JIEZHANGZHONG_FLAG = 4;
    //已结账
    public static final Integer ROOM_YIJIEZHANG_FLAG = 5;
    //并房台
    public static final Integer ROOM_BINGFANGTAI_FLAG = 6;
    //锁定房
    public static final Integer ROOM_SUODINGFANG_FLAG = 7;

    //几种默认支付方式id


    //现金支付
    public static final Integer ZHIFU_XIANJIN_TYPE = 267;
    //现金标识 call add 2019-03-19
    public static final String ZHIFU_XIANJIN_TYPE_FLAG = "XJ";
    //银行支付
    public static final Integer ZHIFU_YINHANG_TYPE = 268;
    //会员卡支付
    public static final Integer ZHIFU_VIP_TYPE = 290;
    //会员卡现抽支付
    public static final Integer ZHIFU_VIP_XIANCHOU_TYPE = 292;
    //卡赠
    public static final Integer ZHIFU_VIP_KAZENG_TYPE = 291;
    //现抽
    public static final Integer ZHIFU_XIANCHOU_TYPE = 293;
    //招待
    public static final Integer ZHIFU_ZHAODAI_TYPE = 359;
    //招待标识
    public static final String ZHIFU_ZHAODAI_TYPE_FLAG = "ZD";
    //签免 caoll add 2017-12-26
    public static final Integer ZHIFU_QIANMIAN_TYPE = 353;
    //挂账
    public static final Integer ZHIFU_GUAZHANG_TYPE = 9999;


    //点单菜品标识(0消费1人为赠送2自动赠送)
    //消费
    public static final Integer DIANDAN_FOOD_XIAOFEI_FLAG = 0;
    //人为赠送
    public static final Integer DIANDAN_FOOD_RENWEI_FREE_FLAG = 1;
    //自动赠送(2.0不要了)
    public static final Integer DIANDAN_FOOD_AUOT_FREE_FLAG = 2;


    //出品状态(0待付款(2.0取消)  1待出品 2已出品 ) 这里是存在账单细项的值   出品表的值是0未出品 1已出品
    //待付款 2.0yichu移除待付款状态
    //public static final Integer CHUPIN_STATUT_FUKUAN = 0;
    //待出品
    public static final Integer CHUPIN_STATUS_WAIT_CHUPIN = 1;
    //已出品
    public static final Integer CHUPIN_STATUS_YI_CHUPIN = 2;

    //   赠送方案菜品池 类型（1消费池 2赠送池）
    public static final Integer ZENGSONG_FANGAN_CHI_LEIXIN_XIAOFEI = 1;
    public static final Integer ZENGSONG_FANGAN_CHI_LEIXIN_ZENGSONG = 2;


    //部门属性
    //队伍属性
    public static final Integer DEPARMENT_SHUXING_DUIWU = 2;
    //营销属性
    public static final Integer DEPARMENT_SHUXING_YINGXIAO = 1;
    //部门
    public static final Integer DEPARMENT_SHUXING_BUMEN = 3;
    //部门里默认的散客id -1
    public static final int DEPARMENT_SANKE_ID = -1;

    //日结状态位
    public static final String SYSTEM_DAY_END_KEY = "system_day_end_key";

    //菜品是否估清
    //估清
    public static final Integer FOOD_CAN_GU_QING_FLAG_GUQING = 1;
    //估清
    public static final Integer FOOD_CAN_GU_QING_FLAG_NORMAL = 0;


    //方案类别
    public static final Integer FANGANLEIBIE_LUODAN = 1;//落单
    public static final Integer FANGANLEIBIE_ZENGSONG = 2;//赠送

    public static void main(String args[]) {
        long i = Long.MAX_VALUE;
        i *= i;
        System.out.println(0x7fffffffffffffffL);
    }

    //退品标识 0正常 1全部退单 2部分退单  caoll  add 2017-09-21
    //未退单
    public static final Integer TUIDAN_WEITUIDAN = 0;
    //全部退单
    public static final Integer TUIDAN_QUANBUTUIDAN = 1;
    //部分退单
    public static final Integer TUIDAN_BUFENTUIDAN = 2;


    //支付方式
    public static final Integer ZHIFU_XianXia = 1;//线下支付
    public static final Integer ZHIFU_WeiXin = 2;//微信
    public static final Integer ZHIFU_ZhiFuBao = 3;//支付宝
    public static final Integer ZHIFU_HuiYuan = 4;//会员

    //ipad支付状态
    public static final Integer IPADZHIFU_WEIZHIFU=0;//未支付
    public static final Integer IPADZHIFU_QUERENZHONG=1;//支付确认中
    public static final Integer IPADZHIFU_YIZHIFU=2;//已支付

    //ipad版本更新类型
    public static final Integer IPADVERSION_UPDATE_NO=0;//不更新
    public static final Integer IPADVERSION_UPDATE_NORMAL=1;//普通更新
    public static final Integer IPADVERSION_UPDATE_MUST=2;//强制更新

    //数据来源
    public static final Integer SHUJULAIYUAN_YEZHI = 0;//业支
    public static final Integer SHUJULAIYUAN_IPAD = 1;//ipad
    public static final Integer SHUJULAIYUAN_YUZHANGGUI = 2;//鱼掌柜


    //支付确认方式
    public static final Integer QUERENFANGSHI_XITONG=1;//系统确认
    public static final Integer QUERENFANGSHI_RENGONG=2;//人工确认

    //ipad扫码支付结果状态(外层错误码 0成功  其他失败   内层业务错误码  00成功  10交易中 01失败)
    public static final Integer IPAD_SAOMA_ZHIFU_STATUS_SUCCESS = 0;//成功00
    public static final Integer IPAD_SAOMA_ZHIFU_STATUS_WAIT = 20;//交易处理中10
    public static final Integer IPAD_SAOMA_ZHIFU_STATUS_FAILUE = 1;//失败01
    //更新对外支付ipad记录的来源
    public static final Integer IPAD_GENGXINLAIYUAN_YEZHI=0;//业支
    public static final Integer IPAD_GENGXINLAIYUAN_YUNDUAN=1;//云端

    //客户端设备类型
    public static final Integer SHEBEITYPE_IPAD=1;//设备类型 ipad

    //日志的处理状态:成功
    public static final Integer LOG_STATUS_SUCCESS = 1;
    //日志的处理状态:报错(系统出异常)
    public static final Integer LOG_STATUS_ERROR = 0;
    //日志的处理状态:失败(业务条件不符合的情况下)
    public static final Integer LOG_STATUS_FAIL = -1;
    //日志的处理状态:预留  不是response的情况下.目前还没有
    public static final Integer LOG_STATUS_UNKNOW = -2;


    public static final int DATE_STATUS_JJDQ = 1;//暂住证或者信息卡即将到期
    public static final int DATE_STATUS_YGQ = 2;//暂住证或者信息卡已过期


    //模块操作入口
    public static final Integer CAOZUORUKOU_ZIKE = 1;//咨客
    public static final Integer CAOZUORUKOU_SHOUYIN = 2;//收银
    public static final Integer CAOZUORUKOU_DIANDAN = 3;//点单
    public static final Integer CAOZUORUKOU_SHANMI = 4;//商秘


    // 获取员工 数据--过滤条件  0  不过滤 1  排除 filterClerk 中的 员工   2  只显示filterClerk 中的员工
    public static final Integer FILTER_FLAG_0 = 0; // 0  不过滤
    public static final Integer FILTER_FLAG_1 = 1; //1  排除 filterClerk 中的 员工
    public static final Integer FILTER_FLAG_2 = 2; //2  只显示filterClerk 中的员工


    // 2.0 新付款类型
    public interface FUKUANLEIXING {
        Integer ZHEGNCHANG = 0; // 正常支付方式
        Integer GUAZHANG = 1; // 挂账
        Integer ZHAODAI = 2; // 招待
        Integer HUIYUANKA = 3; //会员卡
    }

    // 判定值是否为true
    public static boolean isTrue(Object obj) {
        if (obj == null)
            return false;
        if (obj instanceof Integer) {
            return GlobalConstants.TRUE.equals(obj);
        } else if (obj instanceof Long) {
            Long l = (Long) obj;
            return GlobalConstants.TRUE == l.intValue();
        } else if (obj instanceof Boolean) {
            return (boolean) obj;
        }
        return false;
    }

    //没有值时取默认值
    public static <T> T getValueOrDefault(T val, T def) {
        return val == null ? def : val;
    }

}
